package cn.lingyangwl.agile.pay.common.service;

import cn.lingyangwl.agile.pay.model.rqrs.RefundOrderQL;
import cn.lingyangwl.agile.pay.model.rqrs.pay.refund.RefundOrderRS;
import cn.lingyangwl.agile.pay.model.entity.RefundOrder;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

/**
 * @author shenguangyang
 */
public interface RefundOrderService extends IService<RefundOrder> {
    BigDecimal sumSuccessRefundAmount(String payOrderNo);

    boolean updateInit2Ing(String refundOrderId, String channelOrderId);

    boolean updateIng2SuccessOrFail(String refundOrderId, String state, String channelOrderId,
                                    String channelErrCode, String channelErrMsg);

    boolean updateIng2Success(String refundOrderId, String channelOrderId);

    boolean updateIng2Fail(String refundOrderId, String channelOrderId, String channelErrCode, String channelErrMsg);

    IPage<RefundOrderRS> pageRefundOrder(RefundOrderQL req);

    RefundOrder getMchOrder(String mchNo, String mchRefundNo, String refundOrderId);
}
